<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <table id="list">
        <tr id="tr1">
            <td>1</td>
            <td>M</td>
            <td>23</td>
            <td><button onclick="return btnRemoveClick(event)">删除</button></td>
        </tr>
        <tr>
            <td>2</td>
            <td>L</td>
            <td>33</td>
            <td><button onclick="return btnRemoveClick(event)">删除</button></td>
        </tr>
        <tr>
            <td>13</td>
            <td>y</td>
            <td>56</td>
            <td><button onclick="return btnRemoveClick(event)">删除</button></td>
        </tr>

    </table>

    <!--  <button id="btnRemove">删除</button>-->
</body>
<script>

   //1.  alert("hello");  用于程序调试----弹出变量的值
   // 2. confirm
   /*  btnRemove.onclick = function () {
      if(confirm("是否删除当前数据？")){
          alert("删除成功！")
      }
  }*/


   var btnRemove = document.getElementById('btnRemove');

    function btnRemoveClick(event) {
        var list = document.getElementById('list').children[0];
        console.log(list)
       var currentRow= event.target.parentElement.parentElement;

       currentRow.parentElement.removeChild(currentRow);
       // list.removeChild(currentRow);
    }
</script>
</html>